package com.ccsoft.atools.controller;

import com.ccsoft.atools.model.Vue3goods;
import com.ccsoft.atools.model.Vue3goodsPageParam;
import com.ccsoft.atools.service.Vue3goodsService;
import com.ccsoft.atools.utils.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@RequestMapping("/vue3goods")
public class Vue3goodsController {
    @Autowired
    private Vue3goodsService service;

    @GetMapping("/all")
    public JsonResult selectAll() {
        return JsonResult.ok(service.selectAll());
    }

    @PostMapping("/listp")
    public JsonResult listp(@RequestBody Vue3goodsPageParam record) {
        return JsonResult.ok(service.selectByParamLike(record));
    }

    @PostMapping("/insert")
    public JsonResult insert(@RequestBody Vue3goods record) {
        return JsonResult.ok(service.insertSelective(record));
    }

    @PostMapping("/update")
    public JsonResult update(@RequestBody Vue3goods record) {
        return JsonResult.ok(service.updateByPrimaryKeySelective(record));
    }
}
